package imnu.work.work_1;

/**
 * @author: lys
 * @类名: Student
 * @Title:
 * @date: 2020/7/14
 **/
public class Student {
    private int stuId;
    private String stuName;
    private int stuGrade;

    public Student(){
    }

    public Student(int stuId, String stuName, int stuGrade){
        this.stuId = stuId;
        this.stuName = stuName;
        this.stuGrade = stuGrade;
    }

    public int getStuId() {
        return stuId;
    }

    public void setStuId(int stuId) {
        this.stuId = stuId;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public int getStuGrade() {
        return stuGrade;
    }

    public void setStuGrade(int stuGrade) {
        this.stuGrade = stuGrade;
    }

    public static void sortGrade(Student[] s){
        for(int i=0;i<s.length-1;i++){
            for(int j=0;j<s.length-1-i;j++){
                if(s[j].stuGrade<s[j+1].stuGrade){
                    Student t = s[j];
                    s[j] = s[j+1];
                    s[j+1] = t;
                }
            }
        }
    }

    @Override
    public String toString() {
        return "Student{" +
                "stuId=" + stuId +
                ", stuName='" + stuName + '\'' +
                ", stuGrade=" + stuGrade +
                '}';
    }
}
